#include<cstdio>
#include<algorithm>
using namespace std;

long num[400010];

int main()
{
	int size1, size2;
	scanf_s("%d", &size1);
	int i;
	for (i = 0; i < size1; i++)
	{
		scanf_s("%ld", &num[i]);
	}
	scanf_s("%d", &size2);
	for (i = size1; i < size1 + size2; i++)
	{
		scanf_s("%ld", &num[i]);
	}
	sort(num, num + size1 + size2);
	printf("%ld\n", num[(size1 + size2-1) / 2]);
}